<script lang="ts" setup>
import { ref, defineExpose } from 'vue'


//打开弹框
const dialogVisible = ref(false)

const openDialog = () => {
  dialogVisible.value = true
}

const emit = defineEmits(['comfirm'])

const comfirm = () => {
  emit('comfirm')
}

const props = defineProps({
  title: {
    type: String,
    default: '默认标题'
  }
})

defineExpose({
  openDialog,
  dialogVisible
})
</script>
<template>
  <el-dialog v-model="dialogVisible" :title="title" width="500">
    <slot>默认内容</slot>
    <template #footer>
      <div class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="comfirm">
          确认
        </el-button>
      </div>
    </template>
  </el-dialog>
</template>

<style scoped lang="scss"></style>